#include <iostream>
#include <fstream>
#include <set>
#include "BiGraph.h"

using namespace std;

pair<int, int> readGraph(BiGraph< int >& graph) {
    ifstream input("in.txt", ifstream::in);
    if (!input.is_open()) {
        cout<<"No input file!\n";
        system("pause");
        exit(1);
    }
    
    int n = 0;
    input>>n;
    
    int a, b;
    input>>a>>b;
    
    int f, t;
    double w;
    
    while (input.good()) {
          input>>f>>t>>w;
          graph.add_edge(f ,t, w);
    }

    return make_pair(a,b);
}

int main() {
    BiGraph<int> graph(false);
    pair<int,int> edge = readGraph(graph);    
        
    graph.getMinSpanningTreeWithEdge(edge.first, edge.second);
    
    
    system("pause");
    
    return 0;
}
